Skip to content

core: start gloas attester consensus at slot start - #4769

Merged
KaloyanTanev merged 8 commits into
kalo/round-timer-refactorfrom
kalo/gloas-attester-eager-ahead
Oct 13, 2026
Merged

KaloyanTanev merged 8 commits into
kalo/round-timer-refactorfrom
kalo/gloas-attester-eager-ahead

Conversation

@KaloyanTanev

@KaloyanTanev KaloyanTanev commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

From the gloas fork, attester consensus starts at the start of the slot with the new eager_ahead_split timer (rounds of 4s, 1s, 1s, then +1s per round; a re-armed round is extended by its duration past the attestation due time, at least 1s, double_round_on_rearm_min_1s), and the fetcher fetches attestation data on the slot's SSE head event, or at the attestation deadline if no block arrived. fetch_att_on_block becomes stable and fetch_att_on_block_with_delay is removed. Stacked on #4767.

category: feature
ticket: #4324

@KaloyanTanev KaloyanTanev self-assigned this Oct 9, 2026
@github-actions github-actions Bot added the branch-invalid PR raised against invalid branch. Not a main or release branch. label Oct 9, 2026
@KaloyanTanev
KaloyanTanev force-pushed the kalo/gloas-attester-eager-ahead branch 2 times, most recently from a4bdc93 to 7f8c79e Compare October 9, 2026 12:32
@KaloyanTanev
KaloyanTanev marked this pull request as draft October 9, 2026 12:32
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.18919% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.95%. Comparing base (58e30cc) to head (bc51f45).

Files with missing lines Patch % Lines
core/fetcher/fetcher.go 93.33% 4 Missing ⚠️
app/app.go 0.00% 3 Missing ⚠️
core/scheduler/scheduler.go 76.92% 3 Missing ⚠️
core/consensus/qbft/qbft.go 66.66% 1 Missing ⚠️
core/interfaces.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           kalo/round-timer-refactor    #4769      +/-   ##
=============================================================
+ Coverage                      66.76%   66.95%   +0.18%     
=============================================================
  Files                            250      250              
  Lines                          32289    32377      +88     
=============================================================
+ Hits                           21559    21677     +118     
+ Misses                         10729    10699      -30     
  Partials                           1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaloyanTanev
KaloyanTanev force-pushed the kalo/gloas-attester-eager-ahead branch 2 times, most recently from bb6d1e5 to 523702b Compare October 9, 2026 13:50
@KaloyanTanev
KaloyanTanev force-pushed the kalo/gloas-attester-eager-ahead branch from 523702b to bc51f45 Compare October 9, 2026 15:36
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Sequential callbacks delay consensus participation, while timing races can miss or postpone head-event fetching.

4 open findings
What changed in this PR

Adds Gloas-specific attester timing so consensus can begin at slot start and fetch attestation data from SSE head events.

Changes:

  • Adds the eager_ahead_split consensus timer.
  • Adds head-event fetching with deadline fallback.
  • Stabilizes fetch_att_on_block and expands tests/documentation.
File Description
app/​app.go Wires Gloas head events into the fetcher.
app/​featureset/​featureset.go Stabilizes and consolidates attestation fetching flags.
core/​consensus/​qbft/​qbft.go Supplies fork timing to round timers.
core/​consensus/​qbft/​qbft_internal_test.go Updates timer construction tests.
core/​consensus/​qbft/​roundtimer_internal_test.go Tests Gloas rounds in QBFT.
core/​consensus/​timer/​extensions.go Adds per-round rearm extension behavior.
core/​consensus/​timer/​roundtimer.go Selects fork-aware timers and anchors.
core/​consensus/​timer/​roundtimer_internal_test.go Tests durations, anchors, and extensions.
core/​consensus/​timer/​roundtimer_test.go Tests fork-aware timer selection.
core/​consensus/​timer/​timers.go Defines the ahead-split timer.
core/​fetcher/​fetcher.go Implements Gloas head-event fetching and fallback.
core/​fetcher/​fetcher_internal_test.go Tests the new fetching flow.
core/​fetcher/​fetcher_test.go Updates fetcher construction.
core/​interfaces.go Annotates legacy pre-Gloas wiring.
core/​scheduler/​scheduler.go Starts Gloas attester duties at slot start.
core/​scheduler/​scheduler_internal_test.go Tests fork-aware head handling.
core/​scheduler/​scheduler_test.go Tests Gloas scheduling without offset delay.
docs/​consensus.md Documents Gloas timer semantics.
testutil/​integration/​simnet_test.go Adds Gloas attester integration coverage.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/consensus/timer/timers.go
Comment thread core/fetcher/fetcher.go
Comment thread core/fetcher/fetcher.go
Comment thread core/scheduler/scheduler.go
@KaloyanTanev
KaloyanTanev marked this pull request as ready for review October 9, 2026 15:49

@OisinKyne OisinKyne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nothing blocking here but just worth considering

  1. The 3s interval is hard-coded, but the duty offsets are calculated as a fraction of the slot length. That's fine on every 12s network, including the kurtosis deployments (seconds_per_slot: 12). On 5s Gnosis/Chiado, round 1 would start in the previous slot. A cheap guard would be to use eager_dlinear whenever the slot isn't 12s.
  2. The PR description and the code disagree on the re-arm extension. The description says extend_on_rearm_1s; the code is double_round_on_rearm_min_1s, which doubles rounds 4 and up (round 4 gets +2s). Your (Oisin) notes said a fixed re-arm is probably better than doubling, so either make it a fixed 1s or fix the description.
  3. A head event that arrives before the fetcher is waiting gets dropped. It falls back to the 3s path, so nothing breaks, but keeping the latest head event per slot would be a cheap fix.
  4. There's no metric yet for decision time relative to slot start, or for the share of duties decided before the due time, so we can't confirm the improvement on Hoodi.

@KaloyanTanev
KaloyanTanev merged commit 51f19ea into kalo/round-timer-refactor Oct 13, 2026
12 of 13 checks passed
@KaloyanTanev
KaloyanTanev deleted the kalo/gloas-attester-eager-ahead branch October 13, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-invalid PR raised against invalid branch. Not a main or release branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants